//
//  PreviewComponentsCell.m
//  ICrEAM
//
//  Created by Cty on 2016/10/31.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "PreviewComponentsCell.h"
#import "ICMRepairPartsModel.h"
@implementation PreviewComponentsCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    UIView *sperator = [[UIView alloc]initWithFrame:CGRectMake(0, ActualHeight(79), ScreenWidth, 1)];
    sperator.backgroundColor = BackgroundColor_Gray;
    
    [self.contentView addSubview:sperator];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(void)setViewWithObject:(ICMRepairPartsModel *)model{
    self.compName.text = model.PART_NAME;
    self.compCode.text = model.PART_NO;
    self.num.text = model.OBLIGATED_QUANTITY;
    self.perPrice.text = [NSString stringWithFormat:@"%.2f",[model.SALES_PRICE doubleValue]];
    self.totalPrice.text = model.PART_SALES_AMOUNT;
    self.discountLabel.text = model.DISCOUNT_RATE;
    self.compType.text = [model.OEM_TAG isEqualToString:ICMEnumIntToString(ICMEnumYESOrNOYES)]?@"原装零件":@"非原装零件";
}

@end
